import React, {Component} from 'react';
import RouterConfig from './router/rotuer-config'

/*
* HashRouter 使用的是hash模式 #
* BrowserRouter 使用的是history模式 /
* */
import {
  BrowserRouter as Router,
  // Route,
  // Switch,
  // Link,
  // Redirect
} from 'react-router-dom';
import RouterView from "./router/RouterView";

// match  location history
function Home(props) {
  console.log(props.location);
  return (<div>
    <h1>Home</h1>
  </div>)

}

function Page(props) {
  console.log(props);
  return (<div>
    <h1>Page</h1>
  </div>)

}

class Day08 extends Component {
  render() {
    return (
      <Router>
        <div>
        {/*  <Switch>
            <Route path={'/home'} component={Home}/>
            <Route path={'/page'} render={(props)=><Page {...props} children={[1,2,3]}/>}/>
            <Redirect from={'/'} to={'/home'}/>
          </Switch>*/}

          {/*routes : 路由的配置文件*/}
          <RouterView routes={RouterConfig}/>
        </div>
      </Router>
    );
  }
}

export default Day08;
